#ifndef PAGELIST_H
#define PAGELIST_H

#include <QWidget>
#include <QButtonGroup>

QT_BEGIN_NAMESPACE
namespace Ui
{
class PageTurner;
}
QT_END_NAMESPACE

class CPageTurner : public QWidget
{
    Q_OBJECT
public:
    CPageTurner(QWidget *parent = nullptr);
    ~CPageTurner();
	void setPageCount(int pages, int maxShowPages = 10);

signals:
	void sigCurrentPage(int);

private slots:
	void on_btnHomePage_clicked();
	void on_btnLastPage_clicked();
	void on_btnPrePage_clicked();
	void on_btnNextPage_clicked();
	void slotButtonClicked(QAbstractButton *pBtn);

private:
	void adjustPage(int beginPage, bool bLastPageChecked = false);

private:
    Ui::PageTurner *m_ui;
	QButtonGroup m_btnGrp;
	int m_pages;
	int m_maxShowPages;
};
#endif // PAGELIST_H
